<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">插件管理</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li><a href="{:url('plugin/index')}">{:lang('ADMIN_PLUGIN_INDEX')}</a></li>
                                <li class="layui-this"><a href="{:url('plugin/setting')}">{:lang('ADMIN_PLUGIN_SETTING')}</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form method="post" class="layui-form js-ajax-form" action="{:url('plugin/settingPost')}">
                                        <empty name="custom_config">
                                            <include file="plugin/functions" />
                                            {:_parse_plugin_config($data['config'])}
                                            <else />
                                            <present name="custom_config">
                                                {$custom_config}
                                            </present>
                                        </empty>
                                        <div class="layui-form-item layui-layout-admin">
                                            <div class="layui-input-block">
                                                <div class="layui-footer" style="left: 0;">
                                                    <input type="hidden" name="id" value="{$id}" readonly>
                                                    <button type="submit" class="layui-btn js-ajax-submit">{:lang('SAVE')}</button>
                                                    <a class="layui-btn layui-btn-primary" href="javascript:history.back(-1);">{:lang('BACK')}</a>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
    <script>
    layui.config({
        base: '__TMPL__/public/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form', 'laydate', 'colorpicker', 'index'], function() {
        var $ = layui.$,
            element = layui.element,
            form = layui.form,
            laydate = layui.laydate,
            colorpicker = layui.colorpicker;

        element.render();
        colorpicker.render({
            elem: '#test-colorpicker-form-input' //绑定元素
        });


    });

    Wind.use('colorpicker', function() {

        $('.js-color').each(function() {
            var $this = $(this);
            $this.ColorPicker({
                livePreview: true,
                onChange: function(hsb, hex, rgb) {
                    $this.val('#' + hex);
                },
                onBeforeShow: function() {
                    $(this).ColorPickerSetColor(this.value);
                }
            });
        });
    });

    function doSelectLocation(obj) {
        var $obj = $(obj);
        var title = $obj.data('title');
        var $realInput = $obj;
        var location = $realInput.val();

        parent.openIframeLayer(
            "{:url('dialog/map')}?location=" + location,
            title, {
                area: ['700px', '90%'],
                btn: ['确定', '取消'],
                yes: function(index, layero) {
                    var iframeWin = parent.window[layero.find('iframe')[0]['name']];
                    var location = iframeWin.confirm();
                    $realInput.val(location.lng + ',' + location.lat);
                    //$obj.val(location.address);
                    parent.layer.close(index); //如果设定了yes回调，需进行手工关闭
                }
            }
        );
    }
    </script>
</body>

</html>